package com.shiguo365.market.display.activity;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.shiguo365.market.R;
import com.shiguo365.market.display.base.BaseActivity;
import com.shiguo365.market.display.util.ActivityCollector;

import butterknife.ButterKnife;
import butterknife.OnClick;

public class SettingActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_setting);
        ButterKnife.bind(this); //ButterKnife初始化
    }

    @OnClick(R.id.buttonUserLoginout)
    public void loginout(){
        ActivityCollector.finishAll();
        //用户注销登录
        SharedPreferences.Editor editor =getSharedPreferences("data", Context.MODE_PRIVATE).edit();
        editor.clear();
        editor.commit();
        Intent intent= new Intent(this,LoginActivity.class);
        startActivity(intent);
        this.finish();
    }
}
